package com.wb3.organizer.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * 约会实体类
 * 主键：app_id, 外键：account, 创建时间：createdDT, 主题：subject, 地点：location, 日期:appointmentDate,
 * 开始时间：startTime, 结束时间：endTime, 描述:comments
 * @author pharen
 */

@Entity
@Table(name="appointment")
public class Appointment {

	private int app_id;

	private Account account;

	private long createdDT;

	private String subject;

	private String location;

	private Date appointmentDate;

	private Date startTime;

	private Date endTime;

	private String comments;

	@Id
	@Column(name="app_id")
	@GeneratedValue(strategy=GenerationType.AUTO)
	public int getApp_id() {
		return app_id;
	}

	public void setApp_id(int app_id) {
		this.app_id = app_id;
	}

	@ManyToOne
	@JoinColumn(name="acc_id")
	public Account getAccount() {
		return account;
	}

	public void setAccount(Account account) {
		this.account = account;
	}

	@Column(name="createdDT")
	public long getCreatedDT() {
		return createdDT;
	}

	public void setCreatedDT(long createdDT) {
		this.createdDT = createdDT;
	}

	@Column(name="subject")
	public String getSubject() {
		return subject;
	}

	public void setSubject(String subject) {
		this.subject = subject;
	}

	@Column(name="location")
	public String getLocation() {
		return location;
	}

	public void setLocation(String location) {
		this.location = location;
	}

	@Temporal(TemporalType.DATE)
	@Column(name="appointmentDate")
	public Date getAppointmentDate() {
		return appointmentDate;
	}

	public void setAppointmentDate(Date appointmentDate) {
		this.appointmentDate = appointmentDate;
	}

	@Temporal(TemporalType.TIME)
	@Column(name="startTime")
	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	@Temporal(TemporalType.TIME)
	@Column(name="endTime")
	public Date getEndTime() {
		return endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	@Column(name="comments")
	public String getComments() {
		return comments;
	}

	public void setComments(String comments) {
		this.comments = comments;
	}

}
